<style>
    .layui-form .layui-form-item .layui-inline .layui-form-label {
        width: 100px;
    }
</style>
<form class="layui-form seller-form" action="">
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label" >key：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="key" placeholder="key" autocomplete="off"
                       maxlength="50" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" >value：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="value" placeholder="value" autocomplete="off"
                       maxlength="50" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label" >desc：</label>
            <div class="layui-input-inline seller-inline-3">
                <input type="text" name="desc" placeholder="desc" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-sm" lay-submit lay-filter="search"><i class="iconfont icon-chaxun"></i>Search</button>
                <a href="{:url('setAdd')}" class="layui-btn layui-btn-sm"><i class="layui-icon">&#xe608;</i>Add</a>
            </div>
        </div>
    </div>
</form>

<div class="table-body">
    <table id="dataTable" lay-filter="dataTable" ></table>
</div>

<script>
    layui.use(['form',  'table'], function () {
        var tableIn = layui.table.render({
            elem: '#dataTable',
            height: 'full-99',
            cellMinWidth: '80',
            url: "{:url('setting/index')}",
            method:'POST',
            cols: [[
                { type: 'numbers'},
                { field: 'key', align: 'left',  title: 'Key', width: 300},
                { field: 'value', align: 'left',  title: 'Value' , width: 400},
                { field: 'desc', align: 'left',  title: 'Desc'},
                { title: 'action',width:100,
                    templet: function (d) {
                        return '<a class="layui-btn layui-btn-xs" href="{:url(\'setEdit\')}?id=' + d.id + '">Edit</a>';
                    }, align: 'center'
                }
            ]],
            page: true,
            limit: 20,
            limits: [20, 50, 100],
        });
        layui.form.on('submit(search)', function (data) {
            layui.table.reload('dataTable', {
                where: data.field
                , page: {
                    curr: 1 //重新从第 1 页开始
                },
                method:'POST'
            });
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
    });
</script>